<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

</head>
<body>
    <script>
        var xhr = new XMLHttpRequest();

        // 时间回调
        xhr.onreadystatechange = function(){
            if(xhr.readyState==4){
                if(xhr.status==200){
                    alert(xhr.responseText);
                }
            }
        }

        //请求初始化
        xhr.open('get','./php.12',true);

        //正式发送
        xhr.send():


    </script>
</body>
</html>